<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style type="text/css">
        .text{background:red;}
        .text2{background:blue;}
    </style> 
</head>
<body>
    <ul>
    <li>桂花</li>
    <li class="text2">梅花</li>
    <li>菊花</li>
    </ul>
    <input id="btn1" type="button" value="在第一个“ul”中原有列表项之后添加一个“兰花”列表项" />
    <input id="btn2" type="button" value="设置第一个“ul”的“class”属性为“text”"/>
    <input id="btn3" type="button" value="将第一个“ul”的“梅花”列表项替换为“樱花”"/>
    <ul></ul>
    <script>
        document.querySelector('ul').className = 'first-ul'
        document.querySelectorAll('ul')[1].className = 'second-ul'

        $('.first-ul li').on('click',function(){
            $(this).clone().appendTo('.second-ul')
        })

        $('.first-ul li').on('dblclick',function(){
            $(this).prependTo('.second-ul')
        })

        $('#btn1').on('click',function(){
            $('<li>兰花</li>').appendTo('.first-ul')
        })

        $('#btn2').on('click',function(){
            $('.first-ul').addClass('text')
        })

        $('#btn3').on('click',function(){
            $('.first-ul li:contains("梅花")').text('樱花')
        })
    </script>
</body>    
</html>